package components;


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import componentsAbstract.CompAbstract;


public class Button extends CompAbstract{
	
	public Button(WebDriver driver, By buttonName) {

		this.driver = driver;
		this.fieldName = buttonName;
		
	}
	

	public boolean click() throws Exception
	{
		classInfo += " public boolean click()";

		sprawdzFieldObject(classInfo);
		safeClick();
		return true;
		/*try{
		classInfo += " public boolean click()";
		
		sprawdzFieldObject(classInfo);
		
		Actions click = new Actions(driver);
		click.click(fieldObject);
		click.perform();
		//fieldObject.click();
		//Utils.doubleClick(driver, fieldObject);

		}
		catch (StaleElementReferenceException s) {
			int licz=0;
			while(licz<10 && !Utils.safeClickWhileLoopNeeded(driver, fieldName))
			{
				Thread.sleep(1000);
				licz++;
				
			}
		}		
		return true;*/
		
		
	}

}
